<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
<title>信贷分析管理</title><%@include file="/WEB-INF/views/include/dialog.jsp"%>
<meta name="decorator" content="default" />
<script type="text/javascript">
	$(document).ready(function() {
		$("#btnExport").click(function() {
			top.$.jBox.confirm("确认要导出用户数据吗？", "系统提示", function(v, h, f) {
				if (v == "ok") {
					$("#searchForm").attr("action", "${ctx}/bls/loan/export");
					$("#searchForm").submit();
				}
			}, {
				buttonsFocus : 1
			});
			top.$('.jbox-body .jbox-icon').css('top', '55px');
		});
		$("#btnImport").click(function() {
			$.jBox($("#importBox").html(), {
				title : "导入数据",
				buttons : {
					"关闭" : true
				},
				bottomText : "导入文件不能超过5M，仅允许导入“xls”或“xlsx”格式文件！"
			});
		});
	});
	function page(n, s) {
		$("#pageNo").val(n);
		$("#pageSize").val(s);
		$("#searchForm").submit();
		return false;
	}
</script>
</head>
<body>
	<div id="importBox" class="hide">
		<form id="importForm" action="${ctx}/bls/loan/import" method="post"
			enctype="multipart/form-data"
			style="padding-left: 20px; text-align: center;">
			<br /> <input id="uploadFile" name="file" type="file"
				style="width: 330px" /><br /> <br /> <input id="btnImportSubmit"
				class="btn btn-primary" type="submit" value="   导    入   " /> <a
				href="${ctx}/bls/loan/import/template">下载模板</a>
		</form>
	</div>
	<!-- 
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/bls/loan/">信贷分析列表</a></li>
		<shiro:hasPermission name="bls:loan:edit">
			<li><a href="${ctx}/bls/loan/form">信贷分析添加</a></li>
		</shiro:hasPermission>

	</ul> -->
	<div class="breadcrumb">
		<h4>查询信贷信息</h4>
	</div>
	<form:form id="searchForm" modelAttribute="loan"
		action="${ctx}/bls/loan/" method="post" class="breadcrumb form-search">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}" />
		<input id="pageSize" name="pageSize" type="hidden"
			value="${page.pageSize}" />

		<div>
			<label>所属部门 ：</label>
			<tags:treeselect id="office" name="office.id"
				value="${loan.office.id}" labelName="office.name"
				labelValue="${loan.office.name}" title="部门"
				url="/sys/office/treeData" cssClass="input-small" />
			<label>信贷人员 ：</label>

			<form:input path="officerid" htmlEscape="false" maxlength="50"
				class="input-medium" />
			<label>信贷类别 ：</label> <select id="type" name="type">
				<option value="" selected="selected">请选择</option>
				<option value="1">农户</option>
				<option value="2">个体工商户</option>
				<option value="3">城镇自然人</option>
				<option value="4">小企业</option>
				<option value="5">其他</option>
			</select>

		</div>
		<div style="margin-top: 8px;">
			<label>开始日期 ：</label>
			<div class="input-append">
				<script src="${ctxStatic}/My97DatePicker/WdatePicker.js"
					type="text/javascript"></script>
				<input id="inputDate" name="startdate" type="text"
					readonly="readonly" maxlength="20" class="input-medium Wdate"
					value=""
					onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});" />
			</div>
			&nbsp;&nbsp;<label>结束日期 ：</label>
			<div class="input-append">
				<script src="${ctxStatic}/My97DatePicker/WdatePicker.js"
					type="text/javascript"></script>
				<input id="inputDate" name="enddate" type="text" readonly="readonly"
					maxlength="20" class="input-medium Wdate" value=""
					onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});" />
			</div>
			<label>审核状态 ：</label> <select id="ischeck" name="ischeck">
				<option value="" selected="selected">请选择</option>
				<option value="0">待审核</option>
				<option value="2">已审核</option>
				<option value="1">已作废</option>
			</select> &nbsp;<input id="btnSubmit" class="btn btn-primary" type="submit"
				value="查询" />&nbsp;<input id="btnExport" class="btn btn-primary"
				type="button" value="导出" />&nbsp;<input id="btnImport"
				class="btn btn-primary" type="button" value="导入" />
		</div>
	</form:form>
	<tags:message content="${message}" />
	<table id="contentTable" class="table table-striped table-bordered ">
		<thead>
			<tr>
				<th>所属部门</th>
				<th>信贷人员</th>
				<th>信贷类别</th>
				<th>开始日期</th>
				<th>结束日期</th>
				<th>贷款金额</th>
				<th>贷款余额</th>
				<th>应收利息</th>
				<th>实收利息</th>
				<th>未收利息</th>
				<th>审核状态</th>
				<shiro:hasPermission name="bls:loan:edit">
					<th>操作</th>
				</shiro:hasPermission>
			</tr>
		</thead>
		<tbody>
			<c:forEach items="${page.list}" var="loan">
				
				<tr>
					<td><a href="${ctx}/bls/loan/form?id=${loan.id}">${loan.office.name}</a></td>
					<td>${loan.officerid}</td>
					<td><c:if test="${loan.type eq '1'}">农户</c:if> <c:if
							test="${loan.type eq '2'}">个体工商户</c:if> <c:if
							test="${loan.type eq '3'}">城镇自然人</c:if> <c:if
							test="${loan.type eq '4'}">小企业</c:if> <c:if
							test="${loan.type eq '5'}">其他</c:if></td>
					<td>${loan.startdate}</td>
					<td>${loan.enddate}</td>
					<td>${loan.amount}</td>
					<td>${loan.balance}</td>
					<td>${loan.interes}</td>
					<td>${loan.interestactual}</td>
					<td>${loan.interestbalance}</td>
					<td><c:if test="${loan.ischeck eq '2'}">已审核</c:if> <c:if
							test="${loan.ischeck eq '0'}">待审核</c:if> <c:if
							test="${loan.ischeck eq '1'}">已作废</c:if></td>
					
					<shiro:hasPermission name="bls:loan:edit">
						<td><a href="${ctx}/bls/loan/form?id=${loan.id}">修改</a> <a
							href="${ctx}/bls/loan/delete?id=${loan.id}"
							onclick="return confirmx('确认要删除该信贷分析吗？', this.href)">删除</a></td>
					</shiro:hasPermission>

				</tr>
			</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
	<div class="row">

		<div class="span12"></div>
	</div>
</body>
</html>
